package example.spring_aop.controller;

import example.spring_aop.config.MyAspect;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName TestController
 * @Description 测试切面
 * @Author ZJX
 * @Date 2024/9/2 17:36
 * @Version 1.0
 */

@Slf4j
@RequestMapping("/test")
@RestController
public class TestController {

    @MyAspect
    @RequestMapping("/t1")
    public String t1(){
        log.info("执行t1方法...");
        return "t1";
    }

    @RequestMapping("/t2")
    public String t2(){
        log.info("执行t2方法...");
        int a = 10/0;
        return "t2";
    }

}
